---
id: 65687bbfd9a7d6b78cd5b5cf
title: Крок 24
challengeType: 20
dashedName: step-24
---

# --description--

Пройдіться через парні цифри та надрукуйте їх на консолі.

# --hints--

Функція `verify_card_number` повинна містити цикл `for` на `even_digits`.

```js
({
    test: () => {
        const transformedCode = code.replace(/\r/g, "");
        const verify_card_number = __helpers.python.getDef("\n" + transformedCode, "verify_card_number");
        const { function_body } = verify_card_number;

        assert.match(function_body, /for +(\w+) +in +even_digits:/);
    }
})
```

Цикл `for` повинен містити `--fcc-expected--`.

```js
({
    test: () => {
        const transformedCode = code.replace(/\r/g, "");
        const verify_card_number = __helpers.python.getDef("\n" + transformedCode, "verify_card_number");
        const { function_body } = verify_card_number;

        // Get the name of the variable used in the for loop
        const for_loop_variable = function_body.match(/for +(\w+) +in +even_digits:/)?.[1];
        assert.exists(for_loop_variable);

        const [_,lower_function_body] = function_body.split("sum_of_even_digits");

        assert.equal(lower_function_body.match(new RegExp(`print\\(\\s*${for_loop_variable}\\s*\\)`))?.[0], `print(${for_loop_variable})`);
    }
})
```

# --seed--

## --seed-contents--

```py
def verify_card_number(card_number):
    sum_of_odd_digits = 0
    card_number_reversed = card_number[::-1]
    odd_digits = card_number_reversed[::2]

    for digit in odd_digits:
        sum_of_odd_digits += int(digit)
    print(sum_of_odd_digits)

--fcc-editable-region--
    sum_of_even_digits = 0
    even_digits = card_number_reversed[1::2]

--fcc-editable-region--
def main():
    card_number = '4111-1111-4555-1142'
    card_translation = str.maketrans({'-': '', ' ': ''})
    translated_card_number = card_number.translate(card_translation)

    verify_card_number(translated_card_number)

main()
```
